Skip to content

Adding a special case to _common so that Data Ops get a more informative message#1607

Merged
jeromedockes merged 7 commits into
skrub-data:mainfrom
rcap107:dop-better-error-message-dispatch
Sep 19, 2025
Merged

Adding a special case to _common so that Data Ops get a more informative message#1607
jeromedockes merged 7 commits into
skrub-data:mainfrom
rcap107:dop-better-error-message-dispatch

Conversation

@rcap107

@rcap107 rcap107 commented Sep 12, 2025

Copy link
Copy Markdown
Member

I added a check to the dispatch module so that if it gets passed a Data Op a more specific error message is shown.
This should address #1477

With this,

import skrub
import pandas as pd

df = pd.DataFrame({"value": [12,3]})

v = skrub.var("data", df)

skrub.TableReport(v)

gets the message

TypeError: Operation not supported on DataOps. Expecting a Pandas or Polars object, but got a DataOp. You may want to use `.skb.eval()` to evaluate the DataOp and obtain a dataframe.

@rcap107 rcap107 added the data_ops Something related to the skrub DataOps label Sep 12, 2025
@rcap107 rcap107 marked this pull request as ready for review September 12, 2025 14:49
@rcap107 rcap107 added this to the 0.6.2 milestone Sep 12, 2025
Comment thread skrub/_dataframe/_common.py Outdated
Comment thread skrub/_dataframe/_common.py Outdated
Comment thread skrub/_dataframe/tests/test_common.py Outdated
dop = [skrub.var("a")] * n_params
with pytest.raises(
TypeError,
match=r"Operation not supported on DataOps.*Expecting a Pandas*",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change this :)

rcap107 and others added 3 commits September 16, 2025 16:30
Co-authored-by: Gael Varoquaux <gael.varoquaux@normalesup.org>
Comment thread skrub/_dataframe/_common.py

@jeromedockes jeromedockes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you @rcap107 !

@jeromedockes jeromedockes merged commit 9f793ba into skrub-data:main Sep 19, 2025
26 checks passed
rcap107 added a commit to rcap107/skrub that referenced this pull request Sep 25, 2025
rcap107 added a commit that referenced this pull request Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data_ops Something related to the skrub DataOps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants